package code;

import java.util.Scanner;

public class Shaizi_day16 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        int A=sc.nextInt();
        int B=sc.nextInt();
        int A_num=0;
        int B_num=0;
        for(int i=0;i<n;i++){
            int num=sc.nextInt();
            if(num==A){
                A_num++;
            }
            else if(num==B){
                B_num++;
            }
        }
        double p1=(double)A_num/n;
        double p2=(double)B_num/n;
        double p=p1*p2;
        double e=1.0/p;
        System.out.printf("%.1f\n",e);
    }
}
